{% extends "base.html" %}
{%block cabecerahtml%}
	<script type="text/javascript" src="/media/js/cancelar.js"></script>
	<link rel="stylesheet" href="/media/css/basetemp.css" type="text/css" media="screen, projection" />
	<link rel="stylesheet" href="/media/css/tabla.css" type="text/css" media="screen, projection" />
{%endblock%}

{% block contenido %}
<table>
	<form action="/guardar_usuario_existente/" method="post" id="new-user-form">{% csrf_token %}
		<tr>
		<td colspan="2" align="center">                                                             
			{{ form.username.errors }}
		<td>
		</tr>
		<tr>
		<td>Username:</td> 
		<td>{{form.username}}</td>
		</tr>				
		<tr>
		<td colspan="2" align="center">                                                             
			{{ form.first_name.errors }}
		<td>
		</tr>
		<tr>
		<td>Nombre:</td><td> {{form.first_name}}</td>
		</tr>
		<tr>
		<td colspan="2" align="center">                                                             
			{{ form.last_name.errors }}
		<td>
		</tr>
		<tr>
		<td>Apellido:</td><td>{{form.last_name}}</td>
		</tr>
		<tr>
		<td colspan="2" align="center">                                                             
			{{ form.email.errors }}
		<td>
		</tr>
		<tr>
		<td>Email:</td><td> {{form.email}}</td>
		</tr>
		{%if admin %}
		<tr>
		<td>Supervisor:</td><td> {{permisosform.supervisor}}</td>
		</tr>
		<tr>
		<td>Experto:</td><td> {{permisosform.experto}}</td>
		</tr>
		{% endif %}
		<tr>
		<td><input type="submit" class="Editar" value="Editar"/></td>
		{%if admin %}
		<td><input type="submit" onclick="Cancelaradmin(this.form)" class="Cancelar" value="Cancelar"/></td>
		{%else%}
		<td><input type="submit" onclick="Cancelaruser(this.form)" class="Cancelar" value="Cancelar"/></td>
		{% endif %}
		</tr>
	</form>
</table>
{% if not pendiente and not admin %}
	{% if not experto and not supervisor%}
		<a href="/enviar_solicitud/1/"/>Solicitar ser Experto</a>
	{%endif%}
	{% if experto and not supervisor %}
		<a href="/enviar_solicitud/2/"/>Solicitar ser Supervisor</a>
	{%endif%}
{%endif%}
<a href="/cambiarpass"/>Cambiar Contrase&ntildea</a>
{%endblock%}